<nav class="navbar navbar-expand-lg navbar-light bg-white border-bottom">
    <div class="container">
        <a class="navbar-brand fw-bold text-primary" href="{% url 'user:index' %}">校园论坛</a>
        <button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbarNav"
                aria-controls="navbarNav" aria-expanded="false" aria-label="Toggle navigation">
            <span class="navbar-toggler-icon"></span>
        </button>
        <div class="collapse navbar-collapse" id="navbarNav">
            <ul class="navbar-nav me-auto">
                <li class="nav-item">
                    <a class="nav-link" href="{% url 'user:index' %}">首页</a>
                </li>
                <li class="nav-item">
                    <a class="nav-link" href="#">学习交流</a>
                </li>
                <li class="nav-item">
                    <a class="nav-link" href="#">生活分享</a>
                </li>
                <li class="nav-item">
                    <a class="nav-link" href="#">社团活动</a>
                </li>
                <li class="nav-item">
                    <a class="nav-link" href="#">就业招聘</a>
                </li>
            </ul>
            <ul class="navbar-nav">
                <li class="nav-item">
                    <a class="btn btn-primary btn-sm me-2" href="#">发帖</a>
                </li>
                {% if user.is_authenticated %}
                    <li class="nav-item dropdown">
                        <a class="nav-link dropdown-toggle" href="#" role="button" data-bs-toggle="dropdown"
                           aria-expanded="false">
                            {{ user.username }}
                        </a>
                        <ul class="dropdown-menu">
                            <li><a class="dropdown-item" href="#">个人中心</a></li>
                            <li><a class="dropdown-item" href="#">我的帖子</a></li>
                            <li><hr class="dropdown-divider"></li>
                            <li><a class="dropdown-item" href="#">退出</a></li>
                        </ul>
                    </li>
                {% else %}
                    <li class="nav-item">
                        <a class="btn btn-outline-primary btn-sm me-2" href="{% url 'user:login' %}">登录</a>
                    </li>
                    <li class="nav-item">
                        <a class="btn btn-primary btn-sm" href="{% url 'user:register' %}">注册</a>
                    </li>
                {% endif %}
            </ul>
        </div>
    </div>
</nav>